//
//  ERClass.h
//  metadata
//
//  Created by easy on 11-5-30.
//  Copyright 2011 zeasy@qq.com. All rights reserved.
//
 
#import "ERuntime.h"
// ERContext 环境下所有 ERObject 的类标识
@interface ERClass : NSObject {
	Class source;								//类源数据
	ERClassAttributes *attributes;				//类属性
}
#pragma mark property
@property (nonatomic, readonly) Class source;						//类源
@property (nonatomic, readonly) ERClassAttributes *attributes;		//类特性集
@property (nonatomic, readonly) NSString *name;						//类名
@property (nonatomic, readonly) NSUInteger instanceSize;			//实例大小
@property (nonatomic, readonly) int version;
@property (nonatomic, readonly) ERClass *superClazz;		
@property (nonatomic, readonly) NSString *iverLayout;
@property (nonatomic, readonly) NSString *weakIverLayout;
#pragma mark init
//根据Class初始化
-(id) initWith:(Class) aClass;
//根据Class初始化	保证autorelease
+(id) classWith:(Class) aClass;
#pragma mark create instance
-(id) newInstance:(NSUInteger) extraBytes;
-(id) newInstance;
+(BOOL) isSuperClass:(Class) superClazz sub:(Class) subClazz;
#pragma mark field
-(ERField *) instanceFieldWithName:(NSString *) fieldName;
-(ERField *) classFieldWithName:(NSString *) fieldName;
-(NSArray /*ERField*/*) allFields;
-(NSArray /*NSString*/*) allFieldNames;
#pragma mark method
-(ERMethod *) instanceMethodWithName:(NSString *) methodName;
-(ERMethod *) classMethodWithName:(NSString *) methodName;
-(NSArray /*ERMethod*/*) allMethods;
-(NSArray /*NSString*/*) allMethodNames;
#pragma mark property
-(ERProperty *) propertyWithName:(NSString *) propertyName;
-(NSArray /*ERProperty*/*) allProperties;
-(NSArray /*NSString*/*) allPropertyNames;
@end
